home *** CD-ROM | disk | FTP | other *** search
- Path: another.GUN.de!dexam
- From: dexam@another.gun.de (Thomas Fischbacher)
- X-Newsreader: MicroDot 1.10
- Newsgroups: rec.games.programmer,comp.lang.c,comp.lang.c++
- Subject: Re: ! Read me and State your opinion.
- Date: Sat, 13 Apr 1996 18:44:53 +0200
- Message-ID: <xb$YlMD4ED1aez4@dexam.another.gun.de>
- References: <4kegoq$f2d$1@mhadg.production.compuserve.com>
- X-Gateway: ZCONNECT UT tron.gun.de [Z-NEWS 2.6/AMIGA]
-
- On 09.04.1996 [20:19:38] [73627.2516@compuserve.com (Andrew T. Finnell)] wrote the following lines about
- "! Read me and State your opinion."
-
- AF> Hello all fellow C/C++ programmers.
-
- AF> I'd like your opinion on a subject. I recently had a
- AF> argument with one of my friends and he says that C sucks and
- AF> people shouldn't be programming in it and it's more of a hassel to
- AF> program in. He also says that some better language will come out,
- AF> not a add on like C to C++. I think he's full of it so does my
- AF> dad. Yes I'm only 15. I am a pretty good programmer if I do say so
- AF> myself. But my friend says it's to hard to learn and doesn't serve
- AF> the purpose it's supposed too. As in the transportable code. He
-
- When I had been 15, my opinion was very similar to yours.
- It's always the same, regardless whether it's about hardware,
- operating systems, programming languages or whatever else - never judge
- without considerable practical experience with alternatives.
- Now that I have had opportunity to work with quite some rather "exotic"
- languages (from the viewpoint of a C programmer), my opinion has
- completely changed.
-
- C certainly does play a very important role, no one can neglect this; so
- does C++ - with increasing impact.
- Though they have their strengths, both languages have some serious
- weaknesses so that I never would consider to use them for certain
- applications. Remember for example that there is virtually no support
- for recursive data structures. (As one would expect for a rather
- "low-level" language.)
- C/C++ also are full of tripwires; there is no standard size of int's,
- "integral promotions" can easily become very nasty, etc. Come on, there
- are FIFTEEN(!) different operator priorities you have to LEARN, because
- often they are not what you'd suspect. ("if(x & 0xff ==0xc0)"...)
-
- Let's have a look at C++ exception handling for a moment: this "lately"
- introduced and extremely useful feature comes from a language of a
- completely different type. What do we learn from that?
-
- AF> says there's not enough standard librarys as in Text output and
- AF> graphics. I told him that that's why it is called a low-level
-
- OS libraries are of secondary interest when it's about the language.
-
- AF> I think that C/C++ won't be replace but "upgraded". I
- AF> don't know how I can explain to him that C is the language to make
- AF> programs. Also my friends brother is the main reason I wrote this.
-
- True for some special kinds of programs, but certainly not for all.
-
- AF> He doesn't want to learn C because he thinks it will be replaced
- AF> and he'll just have to learn a new language.
-
- Such an attitude will never carry you very far. Those who are
- willing and able to adapt to a big variety of situations usually do best.
-
- AF> Now I think C is awesome and most versitle. I love
-
- I'll give you a short sample code in SML. Tell me how many lines of
- C-code it would be worth. (And how difficult it would be to prove its
- correctness)
-
- datatype TERM = num of real
- | sum of TERM*TERM
- | prod of TERM*TERM
- | diff of TERM*TERM
- | quot of TERM*TERM;
-
- fun eval (num(x)) = x
- | eval (sum(a,b)) = eval a + eval b
- | eval (prod(a,b)) = eval a * eval b
- | eval (diff(a,b)) = eval a - eval b
- | eval (quot(a,b)) = eval a / eval b;
-
- Example:
-
- - val term1= prod(sum(num(1.0),num(2.8)),diff(num(2.0),num(3.6)));
- > val term1 = prod (sum (num 1.0,num 2.8),diff (num 2.0,num 3.6)) : TERM
- - eval term1;
- > ~6.0800000000000001 : real
-
-
- --
- regards, Thomas Fischbacher - dexam@another.gun.de
- fischbac@informatik.tu-muenchen.de
-
- Microsoft Network is prohibited from redistributing this work in any form, in
- whole or in part. License to distribute this post is available to Microsoft
- for $499. Posting without permission constitutes an agreement to these terms.
-
-